package cn.kxx.config;

import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.RedisTemplate;

public class RedisUtil {
    /**
     * 删除指定key的缓存
     * @param redisTemplate
     * @param key
     */
    @Bean
    public static void delete(RedisTemplate redisTemplate, String key){
        if (redisTemplate.hasKey(key)){
            redisTemplate.delete(key);
        }
    }
}